package main

import (
	"context"
	"fmt"
	"github.com/go-redis/redis/v8"
)

//上下文
var ctx = context.Background()

//Type():获取key对应值得类型
func main() {
	rdb := redis.NewClient(&redis.Options{
		Addr:         "81.68.186.20:6379",
		Password:     "ffdd2021@",
		DB:           0,
		MinIdleConns: 2,
	})
	s, err := rdb.Type(ctx, "name").Result()
	if err != nil {
		panic(err)
	}
	fmt.Println(s)
}
